/**
* Created by GoLand.
* User: link1st
* Date: 2019-08-03
* Time: 15:44
 */

package task

import (
	"duoke/utils/upgrade"
	"fmt"
	"runtime/debug"
	"time"
)

func CheckAuthorizeInit() {
	Timer(3*time.Second, 3600*time.Second, checkAuthorize, "", nil, nil)
}

// 服务注册
func checkAuthorize(param interface{}) (result bool) {
	result = true
	defer func() {
		if r := recover(); r != nil {
			fmt.Println("授权验证 stop", r, string(debug.Stack()))
		}
	}()
	upgrade.CheckAuthorize()
	return
}
